{% extends "base.html" %}
{% block title %}{{Title}} - {{Tr(Lang, "name")}}{% endblock %}
{% block body %}
	<div class="ui inverted vertical center aligned segment">
		{% include Page.NavbarTplPath %}
	</div>
	<div class="ui grid documentation container">
		<div class="four wide column">
			<div class="ui vertical menu">
				{% if Toc %}
					{% for node in Toc.Nodes %}
				  <div class="item">
				  	{% if node.Plain %}
				    	<div class="header">{{node.Title}}</div>
				    {% else %}
				    	<a class="header" href="{{Page.DocsBaseURL}}/{{node.Name}}">{{node.Title}}</a>
				    {% endif %}
				    <div class="menu">
				    	{% for file in node.Nodes %}
				    		{% if file.Title %}
				      	<a class="item {% if Page.DocsBaseURL|add:"/"|add:node.Name|add:"/"|add:file.Name == Link %}current{% endif %}" href="{{Page.DocsBaseURL}}/{{node.Name}}/{{file.Name}}">{{file.Title}}</a>
				      	{% endif %}
				      {% endfor %}
				    </div>
				  </div>
				  {% endfor %}
				{% else %}
					<div class="item">
						<div class="header">{{Tr(Lang, "docs.pages")}}</div>
						<div class="menu">
							{% for page in Pages %}
							<a class="item" href="/{{page.Name}}">{{page.Title}}</a>
							{% endfor %}
						</div>
					</div>
				{% endif %}
			</div>
		</div>

		<div class="twelve wide column">
			<div class="ui markdown segment">
				{% if IsShowingDefault %}
					<div class="ui blue message">{{Tr(Lang, "docs.showing_default")}}</div>
				{% endif %}
				{% if Extension.EnableEditPage %}
					<a class="ui blue button" id="edit_page" href="{{EditPageLink}}">{{Tr(Lang, "docs.edit_page")}}</a>
				{% endif %}
				{{Content|safe}}
			</div>

			{% if Extension.EnableDisqus %}
				{% include Page.DisqusTplPath %}
			{% endif %}
			
			{% if Extension.EnableDuoShuo %}
				{% include Page.DuoShuoTplPath %}
			{% endif %}
		</div>
	</div>

	{% include Page.FooterTplPath %}
{% endblock %}
